using System.Collections.Concurrent;
using System.Collections.Generic;
using Lap.Collections;

namespace PpSmsSender
{
    public class ConcurrentPriorityQueue<T> : ConcurrentDictionary<int, ConcurrentQueue<T>>
    {
        private readonly int _priorityLevels;

        public ConcurrentPriorityQueue(int priorityLevels)
        {
            this._priorityLevels = priorityLevels-1;
            this.PrioRange.ForEach(prio => this[prio] = new ConcurrentQueue<T>());

        }
        public IEnumerable<int> PrioRange
        {
            get { return Range.Int32(0, this._priorityLevels); }
        }
    }
}